home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 March
/
EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso
/
earcd
/
comm2
/
amislt14.lha
/
AmiSlate
/
ExampleRexx
/
wait.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1996-01-27
|
3KB
|
60 lines
/* An ARexx script to demonstrate how to use WaitEvent.
Whenever the user does a detectable action, this script will
print out info about it to the console. Set REXXOUTPUT=con:
in your startup arguments/ToolType arguments to see this output */
parse arg CommandPort ActiveString
address (CommandPort)
options results
/* Constants for use with AmiSlate's ARexx interface */
AMode.DOT = 0 /* Two words: x,y */
AMode.PEN = 1 /* Stream of words x,y,x,y,... until STOP_STRING */
AMode.LINE = 2 /* Two words: x,y */
AMode.CIRCLE = 3 /* Three words: x,y,r */
AMode.SQUARE = 4 /* Four words: x1,y1,x2,y2 */
AMode.POLY = 5 /* Stream of words x,y,x,y,... until STOP_STRING */
AMode.FLOOD = 6 /* Two words: x,y */
AMode.DTEXT = 7 /* Stream of single words */
AMessage.TIMEOUT = 1 /* No events occurred in specified time period */
AMessage.MESSAGE = 2 /* Message recieved from remote Amiga */
AMessage.MOUSEDOWN = 4 /* Left mouse button press in drawing area */
AMessage.MOUSEUP = 8 /* Left mouse button release in drawing area */
AMessage.RESIZE = 16 /* Window was resized--time to redraw screen? */
AMessage.QUIT = 32 /* AmiSlate is shutting down */
AMessage.CONNECT = 64 /* Connection established */
AMessage.DISCONNECT = 128 /* Connection broken */
AMessage.TOOLSELECT = 256 /* Tool Selected */
AMessage.COLORSELECT = 512 /* Palette Color selected */
AMessage.KEYPRESS = 1024 /* Key pressed */
do while (1=1)
WaitEvent RESIZE MESSAGE MOUSEDOWN MOUSEUP QUIT CONNECT DISCONNECT TOOLSELECT COLORSELECT KEYPRESS stem e.
t = e.type
if (t = AMessage.TIMEOUT) then say 'Detected Event Timeout'
if (t = AMessage.MESSAGE) then say 'Detected Remote Message'
if (t = AMessage.MOUSEDOWN) then say 'Detected Mouse Down'
if (t = AMessage.MOUSEUP) then say 'Detected Mouse Up'
if (t = AMessage.RESIZE) then say 'Detected Window Resize'
if (t = AMessage.CONNECT) then say 'Detected Connect'
if (t = AMessage.DISCONNECT) then say 'Detected DisConnect'
if (t = AMessage.TOOLSELECT) then say 'Detected Tool Select'
if (t = AMessage.COLORSELECT) then say 'Detected Color Select'
if (t = AMessage.KEYPRESS) then say 'Detected Key Press'
if (t = AMessage.QUIT) then say "QUIT!!!"
if (t = AMessage.DISCONNECT) then say "Disconnect"
say 'X: ' e.x
say 'Y: ' e.y
say 'Code1: ' e.code1
say 'Code2: ' e.code2
say 'Message: ' e.message
say '----------------------'
if (t = AMessage.QUIT) then exit
end